# 导包
import requests

# 请求数据
# http://172.16.18.128/index.php/Home/Goods/search.html?q=iphone

dist = {
    "urlA":"http://172.16.18.128/index.php/Home/Goods/search.html",
    "p":"iphone"
}

print(dist["urlA"])
request = requests.get(url=dist["urlA"],params=dist["p"])

print("输出编码格式：",request.encoding)
# 解决编码格式问题
request.encoding = "utf-8"

print("输入请求返回的数据：",request.text)

# print("输出json数据",request.json())，当返回的数据不为json时，返回提示错误